﻿#ifndef QTNETMSGEVENT_H
#define QTNETMSGEVENT_H

#include <QMainWindow>
#include <QObject>
#include <QWidget>
#include <QString>
#include <QObject>

#include <QThread>
#include <QTcpSocket>
#include <QUdpSocket>
#include <QButtonGroup>
#include "TCP_UDP_Assistant/myserver.h"
#include "TCP_UDP_Assistant/mysocket.h"


enum QtNetMsg_Evt
{
    Evt_OK = 0,
    Evt_Offline = 1,
    Evt_Online = 2,
    Evt_Connect = 3,
    Evt_Err = 4,
    Evt_SeriPtErr = 5,
    Evt_SeriPt_OpenErr = 6,
};

class QtNetMsgEvent : public QObject
{

public:

    QtNetMsgEvent();
    /*
    * 发送信息
    */
    virtual void sendMsg(const QByteArray& msg) = 0;
    /*
    * 发送信息
    */
    virtual void sendMsg(const char* data, quint64 len) = 0;
    /*
    * 获取IP地址
    */
    virtual const QString& get_ip() = 0;
    /*
    *   获取端口
    */
    virtual quint32 get_port() = 0;
    /*
    * 获取私有数据
    */
    virtual void* get_data() = 0;
    /*
    *  设置私有数据
    */
    virtual void set_data(void*) = 0;

    virtual void close() = 0;

    virtual int get_type() = 0;
};

#endif // QTNETMSGEVENT_H
